#pattern = pyglet.image.SolidColorImagePattern((255, 255, 255, 255))
import pyglet
import random

class sky(object):
    def __init__(self):
        self.bands = []
        self.main_batch = pyglet.graphics.Batch()
        
        for i in range(5):
            pattern = pyglet.image.SolidColorImagePattern((25, 25, 255-(i*18), 255))
            image = pyglet.image.create(640, 64, pattern)
            self.bands.append(pyglet.sprite.Sprite(img=image,x=0, y=(416-(i*64)), batch=self.main_batch))
        print len(self.bands)
        
    def draw(self):
        self.main_batch.draw()
        print "p"

# Main
msky = sky()
window = pyglet.window.Window(640,480)

@window.event
def on_draw():
    window.clear()
    msky.draw()
    
pyglet.app.run()

